//
//  MYGSurgicalManSelectViewTableViewCell.swift
//  MYDoctor
//
//  Created by 王振明 on 2024/4/25.
//

import UIKit

class MYGSurgicalManSelectViewTableViewCell: UITableViewCell {
    var modelIn = MYGMyPatientModel(){
        didSet{
            nameLabel.text = modelIn.patient.name
            
        }
    }
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        selectionStyle = .none
        iniUI()
    }
    func iniUI(){
        contentView.addSubview(selectBtn)
        selectBtn.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalToSuperview().offset(22.5)
            make.size.equalTo(CGSize(width: 16, height: 16))
        }
        contentView.addSubview(nameLabel)
        nameLabel.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
//            make.top.equalToSuperview().offset(15)
            make.left.equalTo(selectBtn.snp.right).offset(9)
            make.height.equalTo(18.5)
        }
//        contentView.addSubview(chuanghaoLabel)
//        chuanghaoLabel.snp.makeConstraints { make in
//            make.top.equalToSuperview().offset(16)
//            make.left.equalTo(nameLabel.snp.right).offset(5.5)
//            make.height.equalTo(15)
//        }
        contentView.addSubview(contentdLab)
        contentdLab.snp.makeConstraints { make in
            make.top.equalTo(nameLabel.snp.bottom).offset(7.5)
            make.left.equalTo(selectBtn.snp.right).offset(9)
            make.height.equalTo(12.5)
            make.right.equalToSuperview().offset(-48)
        }
        contentView.addSubview(lineView)
        lineView.snp.makeConstraints { make in
            make.bottom.equalToSuperview()
            make.left.equalToSuperview().offset(45)
            make.height.equalTo(1)
            make.right.equalToSuperview().offset(-45)
        }
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    private lazy var lineView:UIView = {
       let lineV = UIView()
        lineV.backgroundColor = .rgba(238, 238, 238, 1)
        return lineV
    }()
    lazy var selectBtn: UIButton = {
        let cont = UIButton()
        cont.setBackgroundImage(UIImage(named: "MYG_cloudDisk_content_normal"), for: .normal)
        cont.setBackgroundImage(UIImage(named: "MYG_cloudDisk_content_selected"), for: .selected)
        return cont
    }()
    
    private lazy var nameLabel: UILabel = {
        let label = UILabel()
        label.textColor = .rgba(51, 51, 51, 1)
        label.font = .medium(13)
        return label
    }()
    private lazy var chuanghaoLabel: UILabel = {
        let label = UILabel()
        label.textColor = .rgba(128, 128, 128, 1)
        label.font = .regular(11)
        return label
    }()
    private lazy var contentdLab: UILabel = {
        let label = UILabel()
        label.textColor = .rgba(128, 128, 128, 1)
        label.font = .regular(9)
        return label
    }()
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

    }

}
